package robocup.component.actions;

/**
 * A catch action can only be executed by the goalie. This will try to catch the
 * ball. Note that backpasses are not allowed.
 */

public class CatchAction
    extends Action {

  /**
   * The direction, in which the catch-command should be executed.
   */
  private double _direction;

  /**
   * Constructor with catch-direction
   * 
   * @param direction
   *          the direction, in which the catch-command should be executed
   */
  public CatchAction(
      final double direction) {

    this._direction = direction;
    this._type = TYPE.CATCH_BALL;
  }

  /**
   * Returns the actions string representation:
   * 
   * @return (catch &lt;direction&gt;)
   */
  @Override
  public String toString() {

    final StringBuffer buf = new StringBuffer();
    buf.append("(catch ");
    buf.append(this._direction);
    buf.append(")");
    return buf.toString();
  }

  /**
   * @return Returns the direction.
   */
  public double getDirection() {

    return this._direction;
  }
}
